<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>

<style>
.button, .button:visited {
	background: #B34D8A repeat-x;
	display: inline-block;
	padding: 5px 5px 5px;
	color: #fff;
	text-decoration: none;
	-moz-border-radius: 6px;
	-webkit-border-radius: 6px;
	-moz-box-shadow: 0 1px 3px rgba(0,0,0,0.6);
	-webkit-box-shadow: 0 1px 3px rgba(0,0,0,0.6);
	text-shadow: 0 -1px 1px rgba(0,0,0,0.25);
	border-bottom: 1px solid rgba(0,0,0,0.25);
	position: relative;
	cursor: pointer;
	width:100px;
	font-weight:bold;
	text-align:center;
}
</style>
<div class="easyui-layout" fit="true" >
   <t:formvalid formid="formobj" dialog="true"  layout="table" action="" >
       <div region="center"  style="height:180px;" border="0">
      
	        <table style="width: 100%;" cellpadding="0" cellspacing="1" class="formtable" align="center">
		        <tr height="40">
					<td  width="15%" align="center"><label class="Validform_label">客户编号 </label></td>
					<td  class="value" width="35%">
					    <input type="hidden" value="${wo.todoId }" name="todoId" id="todoId"/>
					    <input type="hidden" value="${wo.id }" name="id" id="id"/>
		                ${wo.customerNo }
		            </td>
		            
		            <td width="15%" align="center"><label class="Validform_label">客户名称 </label></td>
					<td class="value" width="35%">
		                ${wo.customerName }
		            </td>
				</tr>
		         <tr height="40">
					<td  width="15%" align="center"><label class="Validform_label">现场地址 </label></td>
					<td  class="value" width="35%">
		                ${wo.localeAddress }
		            </td>
		            
		            <td width="15%" align="center"><label class="Validform_label">联系人 </label></td>
					<td class="value" width="35%">
		                ${wo.contactMan }
		            </td>
				</tr>
				<tr height="40">
					<td  width="15%" align="center"><label class="Validform_label">联系电话</label></td>
					<td  class="value" width="35%">
		                 ${wo.contactPhone }
		            </td>
		            
		            <td width="15%" align="center"><label class="Validform_label">联系地址 </label></td>
					<td class="value" width="35%">
		                ${wo.contactAddress }
		            </td>
				</tr>
				 <tr height="40">
		            <td  width="15%" align="center"><label class="Validform_label">工单编号 </label></td>
					<td  class="value" width="35%" >
					   ${wo.id }
		              
		            </td>
					<td  width="15%" align="center"><label class="Validform_label">工单状态 </label></td>
					<td  class="value" width="35%" >
					    ${wo.woStateDesc }
		              
		            </td>
				</tr>
				<tr height="40">
		            <td  width="15%" align="center"><label class="Validform_label">工单类型 </label></td>
					<td  class="value" width="35%" >
					   ${wo.woTypeDesc }
		            </td>
					<td  width="15%" align="center"><label class="Validform_label">受理时间</label></td>
					<td  class="value" width="35%" > 
					   <fmt:formatDate value="${wo.createDatetime}"  type="both" pattern="yyyy.MM.dd HH:mm:ss"/> 
		            </td>
				</tr>
				<tr >
					<td  width="15%" align="center"><label class="Validform_label">受理内容</label></td>
					<td  class="value" width="85%" colspan="3">
		                <textarea style="height:120px;width:100%;border:0px;" >${wo.woContent }</textarea>
		            </td>
				</tr>
				<tr height="40">
		            <td  width="15%" align="center"><label class="Validform_label">受理部门</label></td>
					<td  class="value" width="35%" >
					   ${wo.createDepartmentname }
					   
		            </td>
					<td  width="15%" align="center"><label class="Validform_label">受理人员</label></td>
					<td  class="value" width="35%" >
					    ${wo.createRealname }
		            </td>
				</tr>
	        </table>
        
         <!-- 已归档的工单不可见 -->
         <c:if test="${wo.woState != 'S00'}">
            <!-- 坐席人员或坐席管理可见 -->
            <c:if test="${LOCAL_CLINET_USER.roleCodes=='seatsmgr' || LOCAL_CLINET_USER.roleCodes=='searters' }">
            
         
           <table style="width: 100%;" cellpadding="0" cellspacing="1"  border="0" class="formtable" align="center">
		       <tr height="40" >
					<td  width="15%" align="center">
					   <label class="Validform_label"  style="color:#B34D8A">我要办理</label>
					</td>
					
				</tr>
		   </table> 
		  
           <table style="width: 100%;" cellpadding="0" cellspacing="1" class="formtable" align="center">
		       <tr >
					<td  width="15%" align="center"><label class="Validform_label">处理意见</label></td>
					<td  class="value" width="85%" colspan="3">
		                <textarea style="height:120px;width:100%;border:0px;" maxlength="500" id="woOpinion" name="woOpinion"></textarea>
		            </td>
				</tr>
			
				<tr height="40">
				  <td  width="15%" align="center">&nbsp;</td>
					<td  class="value" width="85%" colspan="3">
				        
                        <input type="hidden" name="woState" id="woState" value="S00">
                        <a class="button"  onclick="mysubmit();">归&nbsp;&nbsp;&nbsp;&nbsp;档</a>
		            </td>
				</tr>
				
			</table>
		  </c:if>
			
		 </c:if>			
			
			
			<!-- 遍历处理意见 -->			
			<c:forEach var="process" items="${processList }" >  
			     <br/>
				 <table style="width: 100%;" cellpadding="0" cellspacing="1" class="formtable" align="center">
			        <tr height="40">
			            <td  width="15%" align="center"><label class="Validform_label">处理人员 </label></td>
						<td  class="value" width="85%" >
						  ${process.createDepartmentname }&nbsp;&nbsp;${process.createRealname }&nbsp;&nbsp;
						     【${process.woOperadesc }】
			              <span style="float:right">  <fmt:formatDate value="${process.createDatetime}"  type="both" pattern="yyyy.MM.dd HH:mm:ss"/> </span>
			            </td>
					</tr>
					<tr height="40">
			            <td  width="15%" align="center"><label class="Validform_label">处理意见 </label></td>
						<td  class="value" width="85%" >
						   ${process.woOpinion }
			              
			            </td>
					</tr>
				</table>
						  
			</c:forEach>  
						
						
			     
		 </div>
   </t:formvalid>
</div>


<script>
   $(function(){
	   $('#woState').change(function(){ 
		   var p1=$(this).val();
		   if(p1=='S03'){
			   $('#selectDeparton').show();
		   }else{
			   $('#selectDeparton').hide();
		   }
	   });
	   
   });
   
   function mysubmit() {

		$('#formobj').form('submit', {  
			url:'woController.do?saveProcessWO',
		    onSubmit: function(){  
		        //进行表单验证  
		        //如果返回false阻止提交  
		        if($('#woOpinion').val().trim()==''){
		        	$.messager.alert('&nbsp;&nbsp;信息提醒','请填写处理意见！', 'info');
		        	return false;
		        } 
		    },  
		    success:function(data){  
		    	var d = $.parseJSON(data);
		    	$.messager.alert('信息提醒', d.msg, 'info',function(){
		    		$('#main_hasdo_list').layout('collapse','east');
				    $('#hasdoWoList').datagrid('reload');
		    	});
		    }  
		}); 
	
	}

	
</script>